package org.example.chenniyrpcspingbootstarter.annotation;

import Constant.RpcConstant;
import faultTolerant.FaultTolerantCategoryKeys;
import loadBalancer.LoadBalancerCategoryKey;
import retry.RetryStrategyCategoryKeys;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * 服务消费者注解(注入某个对象）
 */
@Target({ElementType.FIELD})//目标元素
@Retention(RetentionPolicy.RUNTIME)//目标环境
public @interface RpcReference {
    Class<?> interfaceClass() default void.class;
    String serviceVersion() default RpcConstant.DEFAULT_SERVICE_VERSION;
    String localBalancer() default LoadBalancerCategoryKey.ROUND_BALANCER;
    String retryStrategy() default RetryStrategyCategoryKeys.FixedTimeRetry;
    String tolerantStrategy() default FaultTolerantCategoryKeys.FAIL_OVER;
    boolean isMock() default false;
}
